In the field of video surveillance, motion of a human face, a pedestrian, or a vehicle is generally detected and tracked using target detection and tracking technology. It also needs to analyze motion information of a target in the field of video compression and robot navigation. Therefore, application scenarios of motion analysis are enriched and have important value. A purpose of motion analysis is to obtain a position offset of an object, so as to track the object. Currently, an optical flow method is usually used to perform motion analysis, and a motion direction and a motion rate of a point in an image can be determined using optical flow calculation. A requirement of the optical flow calculation is that a time interval between adjacent images is very small and no significant change occurs between two adjacent images.
In the prior art, when the optical flow method is used to track a target, a characteristic point is first determined on an object to be tracked in an image; each characteristic point is then tracked one by one using a pyramid optical flow algorithm; a characteristic point with a tracking error is then excluded using a certain criterion; statistics are collected on position offset information of a remaining characteristic point; and a position offset is calculated to obtain a target position of the object to be tracked.
However, different tracking points are prone to ambiguity, thereby resulting in a tracking error and low tracking precision.